#include "Socket.h"
#include <my_head.h>
Socket::Socket(){
    _fd = socket(AF_INET,SOCK_STREAM,0);
    if(_fd < 0){
        perror("socket");
    }
}
Socket::Socket(int fd)
:_fd(fd){}


Socket::~Socket(){
    close(_fd);
}

void Socket::shutdownWirte(){
    //主动断开连接时使用，只关闭写端
    shutdown(_fd,SHUT_WR);
}
